package cn.JHai.service.impl;
import cn.JHai.dao.FavoritesDao;
import cn.JHai.domain.Favorite;
import cn.JHai.domain.Music;
import cn.JHai.domain.User;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import javax.security.auth.login.LoginException;



public class GetMusicService {

	@Autowired
	private FavoritesDao dao;

	// 登录操作
	public ArrayList<Favorite> getFavorite(User user) throws LoginException {
		//根据登录时表单输入的用户名和密码，查找用
		ArrayList<Favorite> list = new ArrayList<Favorite>();
		if (user != null) {
			list = dao.findWithUid(user.getUid());
			return list;
		}
		throw new LoginException("用户不存在，请登录");
	}


}
